package com.hp.bon.sgw.threads;

import java.util.List;

import com.hp.bon.sgw.start.SpringContext;

public class ProcessLogCacheManager extends LogCacheManager {
	private static ProcessLogCacheManager _instance;

	public static ProcessLogCacheManager getInstance() {
		if (_instance == null) {
			_instance = new ProcessLogCacheManager();
		}
		return _instance;
	}

	/**
	 * 先执行父类的构造函数，再执行子类的构造函数
	 */
	public ProcessLogCacheManager() {
		setName("Task-ProcessLogCacheManager");
	}

	@Override
	public void flush2File(Object e) {
		LOG.info("Too many ProcessLog Object in log buffer,lost " + e);
	}

	@Override
	protected void flush2BD(List<Object> tempList) {
		SpringContext.getInstance().getOuterDBDataService().bulkSaveToDB(tempList);
	}
}
